const {
    name
} = require('./package')
const isProduction = process.env.NODE_ENV === 'production'

const publicPath = isProduction ? '/child/vue-app' : '/'
module.exports = {
    outputDir: 'vue-app',
    devServer: {
        headers: {
            'Access-Control-Allow-Origin': '*',
        },
        port: "3002"
    },
    publicPath: publicPath,
    configureWebpack: {
        output: {
            library: `${name}-[name]`,
            libraryTarget: 'umd', // 把微应用打包成 umd 库格式
            jsonpFunction: `webpackJsonp_${name}`
        },
    },
}